import { dataQueryAxios, dataCompanyAxios } from '@/utils/request'

// 监控赛道列表
export const getMonitorsTrackList = (params: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/tracks`,
    method: 'get',
    params: {
      page: 1,
      page_size: 199,
      ...params
    }
  })
}

// 添加赛道监控项
export const addTrackMonitors = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/tracks`,
    method: 'post',
    data
  })
}
// 删除赛道监控项
export const deleteTrackMonitors = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/tracks/${data.id}`,
    method: 'delete',
    data
  })
}

// 监控名单列表
export const getMonitorsRollCallList = (params: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/lists`,
    method: 'get',
    params: {
      page: 1,
      page_size: 199,
      ...params
    }
  })
}
// 删除监控名单
export const deleteMonitorsRollCall = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/lists/${data.id}`,
    method: 'delete',
    data
  })
}
// 更新监控名单
export const updateMonitorsRollCall = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/lists/${data.id}`,
    method: 'put',
    data
  })
}

// 分页列表
export const postCompanyInfoFastSearchPageList = (data: any): Promise<any> => {
  return dataCompanyAxios({
    url: '/companyInfo/fastSearch/pageList',
    method: 'post',
    data
  })
}

// 监控数据项列表
export const getMonitorsDataItemList = (params: any): Promise<any> => {
  return dataQueryAxios({
    url: '/api/data-query/v1/monitors/items',
    method: 'get',
    params
  })
}
// 添加监控项
export const addMonitorsDataItem = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: '/api/data-query/v1/monitors/items',
    method: 'post',
    data
  })
}
// 删除监控数据项
export const deleteMonitorsDataItem = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/items/${data.data_id}?list_id=${data.list_id}`,
    method: 'delete',
    data
  })
}
// 添加企业清单-导出excel
export const importExcelMonitorsDataItem = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/items:upload`,
    method: 'post',
    data
  })
}

// 公司事件统计
export const getCompanyEventsStatistics = (params: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/company-events/statistics`,
    method: 'get',
    params
  })
}
// 公司事件
export const getCompanyEventsList = (params: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/company-events`,
    method: 'get',
    params
  })
}
// 公司列表
export const getCompanyEventsCompanyList = (params: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/company-events/companies`,
    method: 'get',
    params
  })
}
// 数据是否被监测
export const judgeDataHasMonitors = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/monitors/items/has_datas`,
    method: 'post',
    data
  })
}

// 公司是否被收藏
export const judgeCompanyHasCollection = (data: any): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/favorites/companies/items/has_datas`,
    method: 'post',
    data
  })
}
